package com.yipao.db.dao.goods;

import com.yipao.db.domain.goods.GoodsMaterial;
import com.yipao.db.domain.goods.vo.GoodsMaterialReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品原料
 *
 * @author tianhao
 * @date 2020/5/10 13:49
 **/
@Mapper
public interface GoodsMaterialMapper {
    /**
     * 新增
     *
     * @param goodsMaterial
     * @return
     */
    int insert(GoodsMaterial goodsMaterial);

    /**
     * 修改
     *
     * @param goodsMaterial
     * @return
     */
    int update(GoodsMaterial goodsMaterial);

    /**
     * 修改删除状态
     *
     * @param goodsMaterial
     * @return
     */
    int updateDeleteStatus(GoodsMaterial goodsMaterial);

    /**
     * 查询详情
     *
     * @param id
     * @param deleted
     * @return
     */
    GoodsMaterial selectByPrimaryKey(@Param("id") Integer id, @Param("deleted") Integer deleted);


    /**
     * 根据条件查询
     *
     * @param example
     * @return
     */
    List<GoodsMaterial> selectByExample(GoodsMaterialReq example);

    /**
     * 根据原料id查询原料名称
     * @param id
     * @return
     */
    String queryNameById(String id);
}
